package com.hongtao3.hsync.ui;

import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;
import javax.swing.JButton;

public class MyButton extends JButton {
   public MyButton(ImageIcon icon){
	   super(icon);
	   setContentAreaFilled(false);
	   setBorder(null);
	   setBackground(null);
	   init();
   }
   
   private void init(){
	   addMouseListener(new MouseAdapter() {

		@Override
		public void mouseEntered(MouseEvent e) {
			super.mouseEntered(e);
			 setContentAreaFilled(true);
			setBackground(new Color(198,217,234));
		}

		@Override
		public void mouseExited(MouseEvent e) {
			super.mouseExited(e);
			setBackground(null);
			 setContentAreaFilled(false);
		}
		   
	    });
   }
}
